class code3 {
    public int singleNumber(int[] nums) {
        //无脑hash
        Map<Integer,Integer> hash = new HashMap<>();

        for(int x:nums) {
            hash.put(x,hash.getOrDefault(x,0)+1);
        }

        for(int x:hash.keySet()) {
            if(hash.get(x) == 1) {
                return x;
            }
        }
        return -1;
    }
}